<%--
  Created by IntelliJ IDEA.
  User: teacher
  Date: 2022/3/3
  Time: 9:30
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <title>主页</title>
</head>
<body>
<h1>主页</h1>
<c:choose>
    <c:when test="${empty user}">
        <a href="${pageContext.request.contextPath}/register.jsp">注册</a>
        <a href="${pageContext.request.contextPath}/login.jsp">登录</a>
    </c:when>
    <c:otherwise>
        欢迎您:${user.username}
        <a href="${pageContext.request.contextPath}/logout.user">注销</a>
    </c:otherwise>
</c:choose>

</body>
</html>
